﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DBSourceToolsLib.CodeParser
{
    abstract class Chain
    {
        private bool m_bHasLink;
        protected Chain m_Chain;
        public Chain()
        {
            m_bHasLink = false;
        }

        public abstract void sendToChain(List<ParseObject> lstParseObjects);

        public void addToChain(Chain oChain)
        {
            m_Chain = oChain;
            m_bHasLink = true;
        }
        public Chain getChain()
        {
            return m_Chain;
        }
        public bool hasChain() { return m_bHasLink; }

        protected void sendChain(List<ParseObject> lstParseObjects)
        { // send the message on down the chain
            if (m_Chain != null)
                m_Chain.sendToChain(lstParseObjects);
        }
    }
}
